using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using JCTimes.DomainModel.Views;

namespace JCTimes.EFRepository.Mapping
{
    public class V_PDAMap : EntityTypeConfiguration<V_PDA>
    {
        public V_PDAMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.ID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.PDANo)
                .HasMaxLength(50);

            this.Property(t => t.UsersID)
                .HasMaxLength(50);

            this.Property(t => t.CreateUsersID)
                .HasMaxLength(50);

            this.Property(t => t.AccountName)
                .HasMaxLength(50);

            this.Property(t => t.CreateName)
                .HasMaxLength(50);

            this.Property(t => t.Purpose)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("V_PDA");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.PDANo).HasColumnName("PDANo");
            this.Property(t => t.UsersID).HasColumnName("UsersID");
            this.Property(t => t.CreateUsersID).HasColumnName("CreateUsersID");
            this.Property(t => t.CreateDate).HasColumnName("CreateDate");
            this.Property(t => t.AccountName).HasColumnName("AccountName");
            this.Property(t => t.CreateName).HasColumnName("CreateName");
            this.Property(t => t.Purpose).HasColumnName("Purpose");
            this.Property(t => t.Status).HasColumnName("Status");
        }
    }
}
